home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d3
/
rettig.arc
/
TRSOURCE.EXE
/
TR_EOW.PRG
< prev
next >
Wrap
Text File
|
1990-10-22
|
747b
|
27 lines
*********
* EOW
* by Tom Rettig
* modified by Leonard Zerman
* Placed in the public domain by Tom Rettig Associates, 10/22/1990.
*
* Syntax: EOW( <expD> )
* Return: Date of the first Sunday same as or following <expD>
* Note : To make this function return Friday instead of Sunday,
* replace the conditions specified below.
*********
FUNCTION EOW
*
PARAMETERS tr_date
DO CASE
CASE DOW(tr_date) = 1 && replace 1 with 5 to return Friday
RETURN tr_date
CASE DOW(tr_date) = 2 && replace 2 with 7 to return Friday
RETURN tr_date + 6
OTHERWISE
RETURN tr_date + ( 8 - DOW(tr_date) )
ENDCASE && replace 8 with 2 to return Friday
* eofunc EOW